package com.edu.controller;

import com.edu.pojo.Order;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @ProjectName: myApp
 * @Titile: OrderController
 * @Author: Administrator
 * @Description: TODO
 */
@RestController
@RequestMapping("/api/order")
public class OrderController {

    @GetMapping("list")
    public Object getOrder(Integer orderId){
        //模拟获取订单
        List<Order> orders = new ArrayList<>();
        orders.add(new Order().setId(1001).setUsername("admin").setRecName("jack").setAddress("四川成都"));
        orders.add(new Order().setId(1002).setUsername("jack").setRecName("rose").setAddress("四川雅安"));
        orders.add(new Order().setId(1003).setUsername("tomcat").setRecName("eclipse").setAddress("四川成绵阳"));
        return orders;
    }
}
